package com.ruike.alisurface.ui.answerQuestion.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.ruike.alisurface.ui.answerQuestion.ShowQuestionFragment;

import java.util.List;

/**
 * Author: voodoo
 * CreateDate: 2023/11/20 020下午 05:11
 * Description: Fragment 的适配器
 */
public class QuestionFragmentAdapter extends FragmentPagerAdapter {

    FragmentManager fragmentManager;
    List<ShowQuestionFragment> fragmentList;

    public QuestionFragmentAdapter(FragmentManager fragmentManager, List<ShowQuestionFragment> fragmentList) {
        super(fragmentManager);
        this.fragmentManager = fragmentManager;
        this.fragmentList = fragmentList;
    }

    @Override
    public Fragment getItem(int i) {
        return fragmentList.get(i);
    }

    @Override
    public int getCount() {
        return fragmentList == null ? 0 : fragmentList.size();
    }

}
